
package com.central.modules.sys.dao;

import com.central.common.dao.BaseDao;
import com.central.modules.sys.entity.SysMenuEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * 菜单管理
 *
 */
@Mapper
public interface SysMenuDao extends BaseDao<SysMenuEntity> {



    @Select("select t3.permissions from sys_role_user t1 left join sys_role_menu t2 on t1.role_id = t2.role_id " +
            " left join sys_menu t3 on t2.menu_id = t3.id " +
            " where t1.user_id = #{userId} and t3.permissions is not null order by t3.sort_order asc ")
    List<String> getUserPermissionsList(Long userId);
}
